package Ctr;
import java.util.ArrayList;

import DB.*;
import Model.*;
public class CtrRabat 
{
	private DBRabat dbRab;
	
	public CtrRabat()
	{
		dbRab = new DBRabat();
	}
	
	public ArrayList<Rabat> findAlleRabatter()
	{
		return dbRab.getAlleRabater();
	}
	
	public Rabat findRabat(String navn)
	{
		Rabat b = dbRab.findRabatNavn(navn);
		return b;
	}
	
	public void updateRabat(int rabatid, int rabat, String rabattype)
	{
		Rabat rab = new Rabat(rabatid,rabat,rabattype);
		dbRab.updateRabat(rab);
	}
	
	public void deleteRabat(String navn)
	{
		dbRab.deleteRabat(navn);
	}
	
}
